//
//  WeddingCarDetailSKUCell.m
//  BaseProject
//
//  Created by 王洋 on 2021/5/13.
//  Copyright © 2021 王洋. All rights reserved.
//

#import "WeddingCarDetailSKUCell.h"

@implementation WeddingCarDetailSKUCell

+ (CGFloat)calculateHeight {
    return 90;
}

- (void)awakeFromNib {
    [super awakeFromNib];

    CAGradientLayer *gl = [CAGradientLayer layer];
    gl.frame = CGRectMake(0,0,TTScreenWidth-28,80);
    gl.startPoint = CGPointMake(0.5, 1.79);
    gl.endPoint = CGPointMake(0.5, 0);
    gl.colors = @[(__bridge id)[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.0].CGColor, (__bridge id)[UIColor colorWithRed:245/255.0 green:245/255.0 blue:248/255.0 alpha:0.8].CGColor];
    gl.locations = @[@(0), @(1.0f)];
    self.bgView.layer.cornerRadius = 4;
    [self.bgView.layer insertSublayer:gl atIndex:0];
}

- (void)fillCellWithModel:(CommonPackageModel *)model {
    
    if ([model.goodsMold isEqualToString:@"1"]) {
        [self cfgMix];
        self.contentLab1.text = model.headCar;
        self.contentLab2.text = model.followCar;
        self.contentLab3.text = model.carService;
    }else if ([model.goodsMold isEqualToString:@"3"]) {
        [self cfgSingle];
        self.contentLab1.text = model.carTime;
        self.contentLab2.text = model.carMil;
        self.contentLab3.text = model.carColor;
    }
}

- (void)cfgMix {
    self.titleLab1.text = @"头车";
    self.titleLab2.text = @"跟车";
    self.titleLab3.text = @"服务";
}

- (void)cfgSingle {
    self.titleLab1.text = @"使用时长";
    self.titleLab2.text = @"使用公里";
    self.titleLab3.text = @"颜   色";
}

@end
